// https://quotes.money.163.com/fu/service/furank.php?host=/fu/service/furank.php&page=0&query=EXCHANGE:FG&fields=no,NAME,PRICE,UPDOWN,PERCENT,TIME&sort=UPDOWN&order=desc&count=16&type=FG&callback=jQuery17207143512672541588_1553831536842&_=1553831536866

const rp = require('request-promise-native')

async function fetchNews() {
    const url = `https://quotes.money.163.com/fu/service/furank.php?host=/fu/service/furank.php&page=0&query=EXCHANGE:FG&fields=no,NAME,PRICE,UPDOWN,PERCENT,TIME&sort=UPDOWN&order=desc&count=16&type=FG&callback=jQuery17207143512672541588_1553831536842&_=1553831536866`

    const res = await rp(url)

    return res
}


;(async() => {

   console.log("开始爬取api")
   var result= await fetchNews()
   console.log(result)

   var data=result.substring(result.indexOf("(")+1,result.lastIndexOf(")"));

   try {
    var news=JSON.parse(data)
    console.log(news.time) //时间
    console.log(news.list) //股票
    } catch (error) {
        console.log(error)
    }

})()